﻿Public Class Ncliente

    Private objcliente As Datos.Dcliente
    Public Function cargarCliente(ByVal item As Entidades.Ecliente) As Boolean

        Dim oDatos As New Datos.Dcliente
        Dim oClientes As New List(Of Entidades.Ecliente)
        Dim band As Boolean
        Try

            band = oDatos.insertarcliente(item)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function
    'Public Function mostrar() As DataTable
    '    Dim oDatos As New Datos.Dcliente
    '    Try
    '        Return oDatos.mostrarcliente
    '    Catch ex As Exception
    '        Throw New ArgumentException(ex.Message)
    '    Finally
    '        oDatos = Nothing
    '    End Try
    'End Function

    Public Function comboloc() As DataTable
        Dim oDatos As New Datos.Dcliente
        Try
            Return oDatos.llenarcombo
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function vercliente() As DataTable

        Dim oDatos As New Datos.Dcliente
        Try
            Return oDatos.buscarcliente
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function
    Public Function ver() As List(Of Entidades.Ecliente)
        Return objcliente.ver
    End Function
    Public Function busquedanombre(ByVal nom As String) As DataTable
        Dim oDatos As New Datos.Dcliente
        Try
            Return oDatos.busquedaxnombrecli(nom)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function
    Public Function busquedadni(ByVal dni As String) As DataTable
        Dim oDatos As New Datos.Dcliente
        Try
            Return oDatos.busquedaxdnicli(dni)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function
End Class
